import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class MyDrawPanel2 extends JPanel{
	
	public void paintComponent(Graphics g){
		
		g.fillRect(0, 0,this.getWidth(),this.getHeight());
		
		Graphics2D g2d=(Graphics2D) g;
		
		GradientPaint gradient=new GradientPaint(70,70,Color.blue,150,150,Color.orange);
		
		g2d.setPaint(gradient);
		g2d.fillOval(70,70,100,100);
	}
	
	public static void main(String[] args){
		
		JFrame frame=new JFrame();
		
		MyDrawPanel2 panel=new MyDrawPanel2();
		
		frame.getContentPane().add(panel);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(1000,1000);
		frame.setVisible(true);
	}

}
